/**
 * \file errors.c
 * \brief Declaration of manipulation functions for error codes and human
 * readable translation table for these error codes.
 */
#include <stdlib.h>
#include <stdio.h>
#include "errors.h"

#define ERR_STRING_LENGTH 80

char errStrings[][ERR_STRING_LENGTH] = {
	" : Success.\n",
	" : Can't allocate memory.\n",
	" : Unknown file format.\n",
	" : Can't open File.\n",
	" : NULL pointer given as argument.\n"
};

void errorToStderr(const char msg[], ErrCode error) {
	fprintf(stderr, "%s%s", msg, errStrings[error]);
}
